//
// Source code recreated from a .class file by IntelliJ IDEA
// (powered by FernFlower decompiler)
//

package org.yaukie.base.util;

import java.util.Locale;
import org.springframework.context.MessageSource;
import org.springframework.context.i18n.LocaleContextHolder;
import org.springframework.util.StringUtils;

public class MessageTools {
    public MessageTools() {
    }

    public static String message(String code, Object... args) {
        MessageSource messageSource = (MessageSource)SpringContextUtil.getBean(MessageSource.class);
        Locale locale = LocaleContextHolder.getLocale();
        if (StringUtils.isEmpty(locale)) {
            locale = new Locale(Locale.SIMPLIFIED_CHINESE.getLanguage());
        }

        return messageSource.getMessage(code, args, locale);
    }
}
